package com.pgy.backend.mapper;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pgy.backend.entity.Pointer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
@TableName("pointer")
public interface PointerMapper extends BaseMapper<Pointer> {
    @Select("select * from pointer")
    List<Pointer> findAll();
//    @Insert("INSERT INTO pointer (id, pointer_number, super_id, name, divide, note) VALUES (null, #{pointer_number}, #{super_id}, #{name}, #{divide}, #{note})")
//    Boolean myinsert(@Param("id")Integer id,@Param("pointer_number")String pointer_number,@Param("super_id")Integer super_id,@Param("name")String name,@Param("divide")Integer divide,@Param("note")String note);
    @Update("update pointer set pointer_number=#{pointer_number}, super_id=#{super_id}, name=#{name}, divide=#{divide},note=#{note} where id = #{id}")
    // @ResultMap(value = {"resultmap"})
    boolean myupdateById(Pointer pointer);
    @Update("update pointer set assign = 1-assign where id = #{id}")
    boolean myupdateAssign(@Param("id") Integer id);


}
